package domain

import (
	"vrcm/src/vrcm/common/models"
)

type SourceStationConfig struct {
	models.Model

	TenantId        string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	DomainId        int    `json:"domain_id" gorm:"type:bigint unsigned;comment:域名配置id"`
	SourceStationIp string `json:"source_station_ip" gorm:"type:varchar(100);comment:原站地址"`
	Port            string `json:"port" gorm:"type:varchar(10);comment:端口"`
	Weight          int    `json:"weight" gorm:"type:int;comment:权重"`
	Index           int    `json:"index" gorm:"column:config_index;type:int;comment:索引"`
	Priority        int    `json:"priority" gorm:"type:int;comment:优先级 1主 2备"`
	MatchType       string `json:"match_type" gorm:"type:varchar(50);comment: 1 文件后缀名 2 文件目录 3any"`
	MatchRule       string `json:"match_rule" gorm:"type:varchar(100);comment: 匹配规则"`
	OriginHost      string `json:"origin_host" gorm:"type:varchar(100);comment: 回源host"`
	models.ModelTime
	models.ControlBy
}

func (SourceStationConfig) TableName() string {
	return "source_station_config"
}

func (e *SourceStationConfig) Generate() models.ActiveRecord {
	o := *e
	return &o
}

func (e *SourceStationConfig) GetId() interface{} {
	return e.Id
}
